package com.wa.listener.condition;

import com.wa.listener.recommend.EventBean;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

//或者使用@EventListener注解来定义一个监听器
//注：@EventListener(classes={ApplicationEvent.class})中classes监听的类可以是多个，以逗号分开
@Component
public class EventConditionListener2 {

    @EventListener(condition = "#event.eventBean.id=='1'")
//    @EventListener(condition = "#event.source != T(org.ssssssss.magicapi.core.config.Constants).EVENT_SOURCE_NOTIFY")
    public void listen(MyEvent3 event) {
        EventBean sysLog = event.getEventBean();
        System.out.println(sysLog);
    }
}